/*************************************************************************
	> File Name: Plugin.cpp
	> Author: 
	> Mail: 
	> Created Time: 2017年05月25日 星期四 02时59分06秒
 ************************************************************************/

#include "Plugin.h"
#include<cstring>

Plugin::~Plugin()
{
}

Plugin::Plugin()
{
    mainPlugin = NULL;
    mUUID = NULL;
    isSendYes = false;
}

void Plugin::eventListen(JuzEvent *event)
{

}
void Plugin::sendEvent(JuzEvent *event)
{
	if(mainPlugin != NULL && isSendYes)
    mainPlugin->sendEvent(event);
}
void Plugin::registeredEvent(string eName,int priority)
{
	if(mainPlugin != NULL)
    mainPlugin->registeredEvent(eName,priority,mUUID);
}

void Plugin::registeredEvent(string eName, int priority, uuid_t *uid) {

}

void Plugin::bindPlugin(Plugin *mainPlugin,uuid_t *uid)
{
	if(mainPlugin != NULL)
	{
	    this->mainPlugin = mainPlugin;
	    mUUID = uid;
	    bindFinsh();

	    isSendYes = true;//绑定完成之后 才支持发送事件
	}
}

void Plugin::bindFinsh() {

}

